<#-- 导入变量定义文件 -->
<#include "../template/include/assign.ftl">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>订单管理</title>
<#-- 导入静态资源文件 -->
<#include "../template/include/source.ftl">
<link href="${web_static}/admin/css/list.css" rel="stylesheet" type="text/css" />
<style type="text/css">
	.page{
		float:right;
		padding-top: 15px;
		margin-right: 15px;
	}
</style>
</head>
<#include "../template/template_listPage.ftl">
<script type="text/javascript">
	$().ready( function() {
		<#if actionErrors??&&(actionErrors?size > 0)>
			$.dialog({type: "warn", content: "<#list errorMessages as list>${list}<br></#list>",
			 modal: true, autoCloseTime: 3000});
		</#if>
		
		$('.follow-cursor').poshytip({
                    className: 'tip-darkgray',
	                followCursor: true,
	                slide: false
                });
	
	});


</script>
</head>
<body class="list">
	<div class="body">
		<div class="listBar">
			<h1><span class="icon">&nbsp;</span>订单管理&nbsp;<span class="pageInfo"></span></h1>
		</div>
		<@pageList page=(page!) id="listForm" action="${web_base}/go/order!list.htm" query="orderInfoQuery" isEmpty=true>
			<div class="operateBar">
				<label>查找:</label>
				订单编号:
				<input type="text" name="orderInfoQuery.orderId" value="${(orderInfoQuery.orderId)!}">
				客户编号:
				<input type="text" name="orderInfoQuery.customerId" value="${(orderInfoQuery.customerId)!}">
				支付状态：
				<select name="orderInfoQuery.payStatus">
				    <option value="" >全部</option>
					<option value="1" <#if orderInfoQuery?? && orderInfoQuery.payStatus?? && orderInfoQuery.payStatus=="1">selected="selected"</#if> >未支付</option>
					<option value="2" <#if orderInfoQuery?? && orderInfoQuery.payStatus?? && orderInfoQuery.payStatus=="2">selected="selected"</#if> >已支付</option>
					<option value="3" <#if orderInfoQuery?? && orderInfoQuery.payStatus?? && orderInfoQuery.payStatus=="3">selected="selected"</#if> >支付失败</option>
				</select>
				订单状态：
				<select name="orderInfoQuery.orderStatus">
				    <option value="" >全部</option>
					<option value="1" <#if orderInfoQuery?? && orderInfoQuery.orderStatus?? && orderInfoQuery.orderStatus=="1">selected="selected"</#if> >成功</option>
					<option value="2" <#if orderInfoQuery?? && orderInfoQuery.orderStatus?? && orderInfoQuery.orderStatus=="2">selected="selected"</#if> >失败</option>
					<option value="3" <#if orderInfoQuery?? && orderInfoQuery.orderStatus?? && orderInfoQuery.orderStatus=="3">selected="selected"</#if> >取消</option>
					<option value="4" <#if orderInfoQuery?? && orderInfoQuery.orderStatus?? && orderInfoQuery.orderStatus=="4">selected="selected"</#if> >处理中</option>
					<option value="5" <#if orderInfoQuery?? && orderInfoQuery.orderStatus?? && orderInfoQuery.orderStatus=="5">selected="selected"</#if> >申请退款</option>
					<option value="6" <#if orderInfoQuery?? && orderInfoQuery.orderStatus?? && orderInfoQuery.orderStatus=="6">selected="selected"</#if> >退款成功</option>
					<option value="7" <#if orderInfoQuery?? && orderInfoQuery.orderStatus?? && orderInfoQuery.orderStatus=="7">selected="selected"</#if> >退款失败</option>
				</select>
				<span>订单时间</span> <input type="text" id="startTime" name="orderInfoQuery.orderTimeStart"
                    onclick="WdatePicker({skin:'whyGreen',startDate:'%y',dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'#F{$dp.$D(\'endTime\')||\'%y-%M-%d\'}'})"
                           value="${(orderInfoQuery.orderTimeStart?string("yyyy-MM-dd HH:mm:ss"))!}" class="Wdate fixWidth" >
				<span>--</span> <input type="text" id="endTime" name="orderInfoQuery.orderTimeEnd"
                   onclick="WdatePicker({skin:'whyGreen',startDate:'%y',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'startTime\')}',maxDate:'%y-%M-%d'})"
                   value="${(orderInfoQuery.orderTimeEnd?string("yyyy-MM-dd HH:mm:ss"))!}" class="Wdate fixWidth">
				<input type="hidden" name="orderInfoQuery.orderBy" id="orderBy" value="${orderInfoQuery.orderBy}" />
				<input type="hidden" name="orderInfoQuery.orderType" id="order" value="${orderInfoQuery.orderType}" />
				<input type="submit" id="searchButton" class="searchButton" value="" />
			</div>
			<table class="listTable">
				<tr>
					<th width="120">
						<span class="" name="orderId">订单编号</span>
					</th>
					<th>
						<span class="" name="class">分类</span>
					</th>
					<th>
						<span class="" name="type">活动类别</span>
					</th>
					<th>
						<span class="" name="cid">客户编号</span>
					</th>
					<th>
						<span class="" name="amount">订单金额</span>
					</th>
					<th>
						<span class="" name="payType">付款方式</span>
					</th>
					<th>
						<span class="sort" name="order_time">订单时间</span>
					</th>
					<th>
						<span class="" name="status">支付状态</span>
					</th>
					<th>
						<span class="" name="orderStatus">订单状态</span>
					</th>
					<th>
						<span class="" name="start_group_time">开团时间</span>
					</th>
					<th>
						<span class="" name="effective">活动有效期</span>
					</th>
					<th>
						<span class="" name="groups">拼团人数</span>
					</th>
					<th width="100">操作<th/>
				</tr>
				<#if  page??&&page.list??&&(page.list?size gt 0) >			
				<#list page.list as obj>
					<tr>
						<td width="120">
							<a href="${web_base}/go/order!detail.htm?orderId=${(obj.orderId)!}" title="详情">${(obj.orderId)!}</a>
						</td>
						<td>
							<#if obj.activityId??>
							<#if obj.bigName??>
							${(obj.bigName)!}<br>
							</#if>
							<#if obj.smallName??>
							${(obj.smallName)!}<br>
							</#if>
							<#if obj.smallClassId??>
							${(obj.smallClassId)!}
							</#if>
							</#if>
							<#if obj.courseId??>
							<#if obj.courseName??>
							${(obj.courseName)!}<br>
							</#if>
							<#if obj.topicName??>
							${(obj.topicName)!}<br>
							</#if>
							<#if obj.courseSubId??>
							${(obj.courseSubId)!}<br>
							</#if>
							</#if>
						</td>
						<td>
							<#if obj.activityType?? && obj.activityType=="1">
								免费
							</#if>
							<#if obj.activityType?? && obj.activityType=="2">
								拼团
							</#if>
							<#if obj.activityType?? && obj.activityType=="3">
								直接购买
							</#if>
						</td>
						<td>
							${((obj.customerId)!)}
						</td>
						<td>
							${(obj.orderAmount)?string("#.##")!} 
						</td>
						<td>
							<#if obj.payType?? && obj.payType=="1">
								支付宝
							</#if>
							<#if obj.payType?? && obj.payType=="2">
								微信
							</#if>
						</td>
						<td>
							<#if obj.orderTime?exists&&obj.orderTime?is_date>
							${(obj.orderTime)?string("yyyy-MM-dd HH:mm:ss")}
							</#if>
						</td>
						<td>
							<#--支付状态（1：未支付，2：已支付,3:支付失败） -->
							<#if obj.payStatus?? && obj.payStatus=="1">
								未支付
							<#elseif obj.payStatus?? && obj.payStatus=="2">
								已支付
							<#elseif obj.payStatus?? && obj.payStatus=="3">
								支付失败
							</#if>
						</td>
						<td>
							<#-- 订单状态（1：成功，2：失败，3：取消，4：处理中，5：申请退款，6：退款成功，7：退款失败） -->
							<#if obj.orderStatus?? && obj.orderStatus=="1">
								成功
							<#elseif obj.orderStatus?? && obj.orderStatus=="2">
								失败
							<#elseif obj.orderStatus?? && obj.orderStatus=="3">
								取消
							<#elseif obj.orderStatus?? && obj.orderStatus=="4">
								处理中
							<#elseif obj.orderStatus?? && obj.orderStatus=="5">
								申请退款
							<#elseif obj.orderStatus?? && obj.orderStatus=="6">
								退款成功
							<#elseif obj.orderStatus?? && obj.orderStatus=="7">
								退款失败
							</#if>
						</td>
						<td>
							<#if obj.startGroupTime?exists && obj.startGroupTime?is_date>
							${(obj.startGroupTime)?string("yyyy-MM-dd HH:mm:ss")}
							</#if>
						</td>
						<td>
							<#if obj.endTime?exists && obj.endTime?is_date>
								${((obj.endTime)?string("yyyy-MM-dd HH:mm:ss")!)}
							</#if>
						</td>
						<td>
							${(obj.groups)!} 
						</td>
						<td width="100">
							<span class="spanLink" onclick="deleteAc('${(obj.orderId)!}')" title="删除">[删除]</span>
							<br/>
							<#if obj.orderStatus?? && obj.orderStatus=="5">
								<a href="${web_base}/go/order!Auditing.htm?orderId=${(obj.orderId)!}&auditResutlt=6" title="审核通过">审核通过</a>
								<br/>
								<a href="${web_base}/go/order!Auditing.htm?orderId=${(obj.orderId)!}&auditResutlt=7" title="审核不通过">审核不通过</a>
							</#if>
						</td>
					</tr>
				</#list>
				<#else>
				    <tr><td colspan="15">
					<div class="noRecord">
						没有找到任何记录!
					</div>	
					</td>
					</tr>
				</#if>	
			</table>
 
		</@pageList>
	</div>
	
</body>
</html>